-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emit errors/warns on some wrong uses of rustdoc attributes #80300
Conversation
I think this should probably go through FCP - I'll take a look at the code first so the review isn't intermingled with the policy change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments, and I think it would be helpful for @estebank to take a look if you have time.
This comment has been minimized.
This comment has been minimized.
b790ab6
to
febf1d5
Compare
This comment has been minimized.
This comment has been minimized.
febf1d5
to
9209218
Compare
Also, it could be interesting to add a macro like https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/macro.struct_span_err.html for warnings (but without error code). |
9209218
to
9a06773
Compare
I think that's https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.struct_span_lint_hir. |
This comment has been minimized.
This comment has been minimized.
fd06236
to
86abf85
Compare
This comment has been minimized.
This comment has been minimized.
46d72f8
to
fe46d75
Compare
This comment has been minimized.
This comment has been minimized.
fe46d75
to
b6f1c7f
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
b6f1c7f
to
2848ea9
Compare
I don't have time to look at this. r? @Manishearth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks great, would love to have more doc comments
@Manishearth Added a few doc comments in a separate commit. Let me know if you'd want anything else documented. |
@bors r+ thanks! |
📌 Commit 6e8d0db has been approved by |
⌛ Testing commit 6e8d0db with merge ac17b18a35f83579e5f75a8da8a7756f4abc9b17... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
This is the only case of invalid |
@bors r+ |
📌 Commit 804ab9f has been approved by |
☀️ Test successful - checks-actions |
This PR adds a few diagnostics:
#[doc(inline)]
/#[doc(no_inline)]
are foundinvalid_doc_attributes
lint (warn-by-default) which triggers:crate
item#[doc(inline)]
/#[doc(no_inline)]
is used on a non-use
itemThe code could probably be improved but I wanted to get feedback first. Also, some of those changes could be considered breaking changes, so I don't know what the procedure would be?
And finally, for the warnings, they are currently hard warnings, maybe it would be better to introduce a lint?(EDIT: introduced theinvalid_doc_attributes
lint)Closes #80275.
r? @jyn514